import {createRouter, createWebHistory} from "vue-router";

const routes = [{
    path: '/login',
    name: '登录',
    component: () => import('../views/Login/index.vue')
}, {
    path: '/reg',
    name: '注册',
    component: () => import('../views/Reg/index.vue')
}, {
    path: '/',
    name: '主页',
    redirect: '/login',
    component: () => import('../views/Lagout/index.vue'),
    children: [
        {
            path: '/index',
            name: '主页',
            component: () => import('../views/Home/index.vue')
        }, {
            path: '/write',
            name: '新建文档',
            component: () => import('@/views/Home/Write/index.vue')
        }, {
            path: '/sheet',
            name: '新建表格',
            component: () => import('@/views/Home/Sheet/index.vue')
        }, {
            path: '/mind',
            name: '新建脑图',
            component: () => import('@/views/Home/Mind/index.vue')
        }, {
            path: '/know',
            name: '知识库',
            component: () => import('../views/Know/index.vue')
        }, {
            path: '/detail',
            name: '知识库详情',
            component: () => import('../views/Know/Detail/index.vue')
        }, {
            path: '/recycle',
            name: '回收站',
            component: () => import('../views/Recycle/index.vue')
        }
    ]
},]

const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router;
